﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CE.Database;
using CE.Global;

public partial class car_insurance_StepCarMake : MyLanguageAndSessionBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        BindRptCarMake();
    }

    private void BindRptCarMake()
    {
        MyDatabase _db = new MyDatabase();
        DataTable _dt = new DataTable("tblMake");
        SortedList _spList = new SortedList();
        _dt = _db.GetDataTableBySP("sprocGetCarMakeList", _spList);

        if (_dt != null && _dt.Rows.Count > 0)
        {
            rptCarMake.DataSource = _dt;
            rptCarMake.DataBind();
        }

        _dt = null;
        _db = null;
    }
    protected void rptCarMake_ItemCommand(object sender, RepeaterCommandEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
        }

        if (e.CommandName.ToLower().Equals("moreinfo"))
        {
        }
    }

    protected void rptCarMake_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            HyperLink hplCarMake = (HyperLink)e.Item.FindControl("hplCarMake");
            Label lblMakeCode = (Label)e.Item.FindControl("lblMakeCode");
            hplCarMake.NavigateUrl = "~/car-insurance/Class1CarModel.aspx" + "?carmake=" + lblMakeCode.Text;
        }
    }
}
